import type { ILoginForm, ILoginResult } from './types'
import { Http } from '@/utils/http'

enum Api {
  loginApiUrl = '/login',
  logoutApiUrl = '/logout',
  captchaApiUrl = '/captcha',
  profileApiUrl = '/profile',
}

export const CommonApi = {
  login: (data: ILoginForm) => Http.post<ILoginResult>(Api.loginApiUrl, data),
  logout: () => Http.post(Api.logoutApiUrl),
  captcha: () => Http.get(Api.captchaApiUrl),
  profile: () => Http.get(Api.profileApiUrl),
}

export * from './types'
